<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <script type="text/javascript" src="<%=basePath%>js/public.js"></script>
    <style type="text/css">
	BODY,TD {FONT-FAMILY: "宋体"; FONT-SIZE: 10pt;line-height: 15px} 
	</style>
    <title>list input</title>
  </head>
  
  <body>
    <br>
	<s:form action="addl" namespace="/" method="post">
		<h3>Test<br></h3>
		<fieldset><legend>T3</legend>
		<table width="100%" border=0><tr>
			<td><s:textfield name="t3.id" label="t3.id:" readonly="true"></s:textfield> </td>
			<td><s:textfield name="t3.name" label="t3.name:" readonly="true"></s:textfield></td>
		</tr></table>
		</fieldset>
		<br>
		<fieldset><legend>t2 list</legend>
		<table width=100% border=0 id="stockTable">
		<tr>
			<td><input type="checkbox" onclick="checkAll(this)"></td>
			<td>t2.id</td>
			<td>t2.name</td>
		</tr>
		<s:iterator value="${ttl}" var="tt" status="ss">
			<tr>
			<td><input type="checkbox" name="check" value="${tt.id}"></td>
			<td><input name="ttl[${ss.index }].id" size="15" value="${tt.id}"></td>
			<td><input name="ttl[${ss.index }].name" size="15" value="${tt.name}"></td>
			</tr>
		</s:iterator>
		</table>
		<table width="100%" border="0">
		<tr>
			<td width="20">&nbsp;</td>
			<td><input type="button" value="添加行" onclick="insertRow()">
				<input type="button" value="删除行" onclick="deleteRow()"></td>
			<td colspan="2">&nbsp;</td>
		</tr>
		</table>
		</fieldset>
		<br>
		<div align="right"><s:submit onclick="resetIndex()" value="保存数据"></s:submit></div>
	</s:form>
</body>
</html>
